﻿using HomagChina.Basic.CCT.PLC;
using HomagGroup.Base.Communication.Items;
using HomagGroup.Base.Communication.Items.Config;
using S7.Net;
using System.Collections.Generic;
using System.Configuration;
using System.Windows.Documents;
using TwinCAT;

namespace Proxy
{
    public static class Globle
    {
        /// <summary>
        /// 进料功能是否激活
        /// </summary>
        public static bool isInfeedAreaActive = false;

        /// <summary>
        /// 出料功能是否激活
        /// </summary>
        public static bool isOutfeedAreaActive = false;

        /// <summary>
        /// H330_1是否开启
        /// </summary>
        public static bool isDRILLTEQActive_1 = false;

        /// <summary>
        /// H330_2是否开启
        /// </summary>
        public static bool isDRILLTEQActive_2 = false;

        /// <summary>
        /// ABL220是否开启
        /// </summary>
        public static bool isABL220Active = false;

        /// <summary>
        /// 清空所有功能是否激活
        /// </summary>
        public static bool isRunEmptyActive = false;

        /// <summary>
        /// 取消所有功能是否激活
        /// </summary>
        public static bool isCanCelAllActive = false;

        /// <summary>
        ///
        /// </summary>
        public static ItemManager itemManager = null;

        /// <summary>
        ///
        /// </summary>
        public static ItemManagerConfig itemManagerConfig = null;

        /// <summary>
        /// 
        /// </summary>
        public static Item Item;
        public static Plc siemensPlc;
        /// <summary>
        /// 操作模式
        /// </summary>
        public static string OpreationMode = "Auto";

        public static string CoreMachine1_IP = ConfigurationManager.AppSettings["CoreMachine1_IP"].ToString();

        public static List<string> List_MachineryOfInfeed = new List<string>() { "CT015", "BC010" };

        public static List<string> List_Machinery = new List<string>() { "MO1_H330L", "MO1_H330R" };

        public static List<string> List_MachineryOfOutfeed = new List<string>() { "CT020" };

        public static List<RouteInfoModel> RoutesInfo = new List<RouteInfoModel>()
        {
            #region ROUTEID 1
            new RouteInfoModel()
            {
                RouteId = 1,
                SourcePosition = "CT015",
                TargetPosition = "MO1_H330L",
                Direction = 40
            },
            new RouteInfoModel()
            {
                RouteId = 1,
                SourcePosition = "MO1_H330L",
                TargetPosition = "CT020",
                Direction = 10
            },
            new RouteInfoModel()
            {
                RouteId = 1,
                SourcePosition = "CT020",
                TargetPosition = "OFF",
                Direction = 10
            },
            #endregion

            #region ROUTEID 2
            new RouteInfoModel()
            {
                RouteId = 2,
                SourcePosition = "CT015",
                TargetPosition = "MO1_H330R",
                Direction = 50
            },
            new RouteInfoModel()
            {
                RouteId = 2,
                SourcePosition = "MO1_H330R",
                TargetPosition = "CT020",
                Direction = 10
            },
            new RouteInfoModel()
            {
                RouteId = 2,
                SourcePosition = "CT020",
                TargetPosition = "OFF",
                Direction = 10
            },
            #endregion

            #region ROUTEID 3
            new RouteInfoModel()
            {
                RouteId = 3,
                SourcePosition = "CT015",
                TargetPosition = "MO1_H330L",
                Direction = 60
            },
            new RouteInfoModel()
            {
                RouteId = 3,
                SourcePosition = "MO1_H330L",
                TargetPosition = "CT020",
                Direction = 10
            },
            new RouteInfoModel()
            {
                RouteId = 3,
                SourcePosition = "CT020",
                TargetPosition = "OFF",
                Direction = 10
            },
	        #endregion

            #region ROUTEID 4
            new RouteInfoModel()
            {
                RouteId = 4,
                SourcePosition = "CT015",
                TargetPosition = "BC010",
                Direction = 99
            },
            new RouteInfoModel()
            {
                RouteId = 4,
                SourcePosition = "BC010",
                TargetPosition = "OFF",
                Direction = 10
            },
	        #endregion

            #region ROUTEID 5
            new RouteInfoModel()
            {
                RouteId = 5,
                SourcePosition = "BC010",
                TargetPosition = "CT015",
                Direction = 10
            },
	        #endregion
        };

        public static List<RouteInfoModel> RouteInfo = new List<RouteInfoModel>();
    }
}













